1. Field of the Invention
The present invention relates to a device and a method for encoding a digital image as well as a program, and more particularly, to a device and a method for encoding a digital image as well as a program in which a joint photographic coding experts group (JPEG) 2000 (ISO/IEC 15444-1) system is used.
2. Description of the Related Art
In JPEG 2000 (ISO/IEC 15444-1) which is an international standard of the ISO/IEC, an image quality of a low bit rate has been improved as compared with conventional JPEG (ISO/IEC 10918). In the JPEG 2000, image compression which permits image distortion is possible, and distortion is added to an image while an image quality is adjusted on an encoder side to enable effective compression thereof.
However, in terms of only compression performance, no such big improvements can be seen for the JPEG.
On the other hand, an example of the conventional art of this kind is disclosed in JP-A-2000-197050. According to this disclosed technology, a face area recognizing section extracts a face area from an image based on a variable coefficient obtained by wavelet conversion, a quantizing section executes a quantization process for an entered variable coefficient while switching a quantization coefficient used for a quantization process outside and inside the extracted face area, and high-performance image quantization which maintains a high image quality is accordingly achieved by a simple process.
However, this disclosed technology concerns the wavelet conversion and the quantization process, but not an entropy encoding process of a next stage.
Thus, an object of the present invention is to provide a device and a method for encoding a digital image, and a program, where in the JPEG 2000 the entropy encoding process is improved to enhance image compression performance while maintaining an image quality.
In order to achieve the object, there is provided a digital image encoding device of the present invention comprises: conversion means for converting digital image data into a coefficient based on a spatial frequency; quantization means for quantizing the coefficient obtained by the conversion means; and coefficient bit modeling means for carrying out coefficient bit modeling by using the coefficient quantized by the quantization means. The digital image data is divided into a plurality of subbands in the conversion means. The coefficient bit modeling means includes: code block division means for dividing each of the subbands into a plurality of code blocks; bit plane decomposition means for decomposing each of coefficients of the code blocks obtained by the code block division means into a plurality of bit planes for each bit weight; subbit plane decomposition means for decomposing each of the bit planes obtained by the bit plane decomposition means into a plurality of subbit planes based on usefulness; and predetermined data generation means for generating predetermined data in accordance with the subbit planes obtained by the subbit plane decomposition means. The coefficient bit modeling means includes requantization means for requantizing a predetermined subbit plane among the subbit planes obtained by the subbit plane decomposition means and passing data after the requantization to the predetermined data generation means.
In order to achieve the object, there is provided a digital image encoding method of the present invention comprises: conversion step of converting digital image data into a coefficient based on a spatial frequency; quantization step of quantizing the coefficient obtained by the conversion step; and coefficient bit modeling step of carrying out coefficient bit modeling by using the coefficient quantized by the quantization step. The digital image data is divided into a plurality of subbands in the conversion step. The coefficient bit modeling step includes: code block division step of dividing each of the subbands into a plurality of code blocks; bit plane decomposition step of decomposing each of coefficients of the code blocks obtained by the code block division means into a plurality of bit planes for each bit weight; subbit plane decomposition step of decomposing each of the bit planes obtained by the bit plane decomposition step into a plurality of subbit planes based on usefulness; and predetermined data generation step of generating predetermined data in accordance with the subbit planes obtained by the subbit plane decomposition step. The coefficient bit modeling step includes requantization step of requantizing a predetermined subbit plane among the subbit planes obtained by the subbit plane decomposition step and passing data after the requantization to the predetermined data generation step.
In order to achieve the object, there is provided a program for causing a computer to perform a digital image encoding method of the present invention. In the program, the method comprises: conversion step of converting digital image data into a coefficient based on a spatial frequency; quantization step of quantizing the coefficient obtained by the conversion step; and coefficient bit modeling step of carrying out coefficient bit modeling by using the coefficient quantized by the quantization step. The digital image data is divided into a plurality of subbands in the conversion step. The coefficient bit modeling step includes: code block division step of dividing each of the subbands into a plurality of code blocks; bit plane decomposition step of decomposing each of coefficients of the code blocks obtained by the code block division means into a plurality of bit planes for each bit weight; subbit plane decomposition step of decomposing each of the bit planes obtained by the bit plane decomposition step into a plurality of subbit planes based on usefulness; and predetermined data generation step of generating predetermined data in accordance with the subbit planes obtained by the subbit plane decomposition step. The coefficient bit modeling step includes requantization step of requantizing a predetermined subbit plane among the subbit planes obtained by the subbit plane decomposition step and passing data after the requantization to the predetermined data generation step.